<?php

namespace App\Http\Requests\Api;

class SearchEngineRequest extends ApiRequest
{
    public function rules()
    {
        return [
            'id' => !$this->is('*/update') ? '' : 'required',
            'sex' => 'integer|between:0,2',
            'education' => 'integer',
            'age' => 'integer',
            'work_year' => 'integer',
            'release_date' => 'integer',
            'keyword_type'=>'required_with:key_word|integer|between:1,3',
            'search_name' => 'required'
        ];
    }

    public function attributes()
    {
        return [
            'sex' => '性别要求',
            'education' => '学历要求',
            'age' => '年龄要求',
            'work_year' => '工作经验',
            'release_date' => '发布日期',
            'keyword_type'=>'关键字类型',
            'search_name' => '搜索器名字',
        ];
    }
}
